<template>
  <div>
    <!-- $emit触发自定义事件 -->
    <button @click="$emit('add-one')">+1</button>
    <button @click="$emit('addn', 4, 5)">+n</button>
    <hr />
    <button @click="$off('add-one')">解绑add-one自定义事件</button>
    <button @click="$off(['add-one', 'addn'])">解绑所两个事件</button>
    <button @click="$off()">解绑所有自定义事件</button>
  </div>
</template>

<script>
  export default {
    name: "Child",
    methods: {},
  };
</script>

<style></style>
